package com.little.pattern.observer;

/**
 * Created by littleshu on 18/5/5.
 */
public class XiaoZhang implements Observer {
    private Subject subject;

    @Override
    public void update() {
        learn();
    }

    public void tell(Subject subject) {
        this.subject = subject;
        this.subject.registerObserver(this);
    }

    public void sleep() {
        System.out.println("小张在睡觉");
    }

    public void learn() {
        System.out.println("小张开始装做学习");
    }
}
